namespace keyofff {
    type Person = {
        name: string;
        age: number;
        isEmployed: boolean;
    }
    type PersonKeys = keyof Person;

    function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
        return obj[key];
    }
    let person = { name: 'Alice', age: 30 };
    let name = getProperty(person, 'name');
    console.log(name)


    type Config = {
        apiEndpoint: string;
        timeout: number;
    }
    function updateConfig<K extends keyof Config>(key: K, value: Config[K]) {
        console.log(key)
        console.log(value)
    }
    updateConfig('apiEndpoint', 'https://api.example.com');

    type Person1 = {
        name: string;
        age: number;
        isEmployed: boolean;
    }
    type PersonPartial = {
        [K in keyof Person1]?: Person1[K];
    }
    let partialPerson: PersonPartial = {
        name: 'Bob'
    }
    console.log(partialPerson.name)



}